package com.test2;

public class Main22 {

	public static int answer2(String str) {
		int res = 0;
		for(int i = 1; i < str.length(); i++) {
			int a = helper(str.substring(0, i));
			int b = helper(str.substring(i));
			res += a * b;
		}
		return res;
	}

	private static int helper(String s) {
		if(s.length() == 1) return 1;
		if(s.charAt(0) == '0' && s.charAt(s.length() - 1) == '0') return 0;
		if(s.charAt(0) == '0' || s.charAt(s.length() - 1) == '0') return 1;
		return s.length();
	}

	private static int an(int n, int[] a) {
		int res = 0;
		int i = 0;
		for(; i < n - 1; i++) {
			if(a[i] == a[i + 1]) {
				res++;
			} else {
				if(a[i] < a[i+1]) {

				}
			}
		}
		return res;
	}
}
